{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5-final"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python38564bitvenvvenv9efd950bbdd2494f8072faf3b588558e",
   "display_name": "Python 3.8.5 64-bit ('.venv': venv)",
   "language": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "source": [
    "# Unsplash Image Search\n",
    "\n",
    "The project allows you to search images on Unsplash by using a natural words description. It is powered by OpenAI's [CLIP model](https://github.com/openai/CLIP).\n",
    "\n",
    "Use this notebook to setup your environment."
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "## Install the Dependencies\n",
    "\n",
    "To install the project's dependencies (including those for CLIP) run the following in the terminal. It is a good idea to create a virtual environment.\n",
    "\n",
    "```\n",
    "pip install -r requirements.txt\n",
    "```"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "## Clone the CLIP repository and copy the code"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Cloning into 'CLIP'...\n",
      "remote: Enumerating objects: 24, done.\u001b[K\n",
      "remote: Total 24 (delta 0), reused 0 (delta 0), pack-reused 24\u001b[K\n",
      "Receiving objects: 100% (24/24), 6.20 MiB | 4.26 MiB/s, done.\n",
      "Resolving deltas: 100% (9/9), done.\n"
     ]
    }
   ],
   "source": [
    "# Clone the CLIP repository\n",
    "!git clone https://github.com/openai/CLIP.git\n",
    "\n",
    "# Move the CLIP source files and the vocabulary in the root directory. \n",
    "# Unfortunately, the CLIP code is not organized as a module, so it cannot be imported easily\n",
    "!mv CLIP/*.py .\n",
    "!mv CLIP/*.gz .\n"
   ]
  }
 ]
}